package com.huluobo.base.db

import android.content.Context
import androidx.room.Room

/**
 *  Created by LC on 2024/7/26.
 */
object AppDBUtils {
    private lateinit var database: AppDatabase

    fun init(context: Context) {
        database = Room.databaseBuilder(context, AppDatabase::class.java, "shopping.db")
            .allowMainThreadQueries()//允许主线程查询
            .build()
    }

    fun getDb(): AppDatabase = database
}